local skel = fk.CreateSkill {
  name = "rmt__chiguo",
  tags = {Skill.Compulsory},
}

Fk:loadTranslationTable{
  ["rmt__chiguo"] = "笞国",
  [":rmt__chiguo"] = "锁定技，每局游戏你至多使用三张【杀】；当你使用【杀】结算后，令你摸牌阶段摸牌数+1；你执行的击杀奖惩改为重置使用"..
  "【杀】次数。",

  ["@rmt__chiguo"] = "笞国",
}

skel:addEffect(fk.CardUseFinished, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) then
      return target == player and data.card.trueName == "slash"
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:addPlayerMark(player, skel.name, 1)
  end,
})

skel:addEffect(fk.BuryVictim, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(skel.name) then
      return data.killer == player and not (data.extra_data or Util.DummyTable).skip_reward_punish
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    data.extra_data = data.extra_data or {}
    data.extra_data.skip_reward_punish = true
    player:setCardUseHistory("slash", 0, Player.HistoryGame)
    room:setPlayerMark(player, "@rmt__chiguo", 3)
  end,
})

skel:addEffect("prohibit", {
  prohibit_use = function(self, player, card)
    return player:hasSkill(skel.name) and card and card.trueName == "slash" and player:usedCardTimes("slash", Player.HistoryGame) > 2
  end
})

skel:addAcquireEffect(function (self, player, is_start)
  player.room:setPlayerMark(player, "@rmt__chiguo", 3 - player:usedCardTimes("slash", Player.HistoryGame))
end)

skel:addLoseEffect(function (self, player, is_death)
  player.room:setPlayerMark(player, "@rmt__chiguo", 0)
end)

skel:addEffect(fk.AfterCardUseDeclared, {--本身只是提示作用，就不限牌名了
  can_refresh = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name, true)
  end,
  on_refresh = function (self, event, target, player, data)
    player.room:setPlayerMark(player, "@rmt__chiguo", 3 - player:usedCardTimes("slash", Player.HistoryGame))
  end,
})

skel:addEffect(fk.DrawNCards, {
  can_refresh = function (self, event, target, player, data)
    return target == player and player:getMark(skel.name) > 0
  end,
  on_refresh = function (self, event, target, player, data)
    data.n = data.n + player:getMark(skel.name)
  end,
})

return skel
